package bx.com.smartcashier.mode;/**
 * Created by boxun on 2018-12-19.
 */


import android.os.Parcel;
import android.os.Parcelable;

import java.math.BigDecimal;

/**
 * @ClassName GoodsDetailsVo
 * @Description
 * @Author zp
 * @Date 2018-12-19 20:11
 * @Version 1.0
 **/

public class GoodsDetailVO implements Parcelable {

    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 企业ID
     */
    private Integer companyId;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 颜色ID
     */
    private Integer colorId;

    /**
     * 颜色规格值
     */
    private String colorValue;

    /**
     * 尺码码段ID
     */
    private Integer sizeId;

    /**
     * 尺码码段值
     */
    private String sizeValue;

    /**
     * 商品条形码
     */
    private String barCode;

    /**
     * 零售价
     */
    private BigDecimal retailPrice;

    /**
     * 批发价
     */
    private BigDecimal wholesalePrice;

    /**
     * 采购价
     */
    private BigDecimal purchasingPrice;

    /**
     * 成本价
     */
    private BigDecimal costPrice;

    /**
     * 自定义价1
     */
    private BigDecimal customPrice1;

    /**
     * 自定义价2
     */
    private BigDecimal customPrice2;

    /**
     * 自定义价3
     */
    private BigDecimal customPrice3;

    /**
     * 商品库存
     */
    private Integer count;

    /**
     * 商品单位
     */
    private String goodsUnit;

    /**
     * 商品波段值
     */
    private String goodsBand;

    private String uniqueCode;

    private String goodsName;

    private Integer goodsEpcid;

    private String goodsCode;

    /**
     * 判断该商品详情是否被引用
     */
    private String edait;

    /**
     * 商品详情id：打印使用
     */
    private Integer goodsDetailId;
    /**
     * 是否选中结算
     */
    private Boolean isChecked=true;

    /**
     * 支付个数
     */
    private Integer buyCount=1;


    private  String  mycode;


    public String getMycode() {
        return mycode;
    }

    public void setMycode(String mycode) {
        this.mycode = mycode;
    }

    public  GoodsDetailVO(){

    }

    public GoodsDetailVO(Integer id, Integer companyId, Integer goodsId, Integer colorId, String colorValue, Integer sizeId, String sizeValue, String barCode, BigDecimal retailPrice, BigDecimal wholesalePrice, BigDecimal purchasingPrice, BigDecimal costPrice, BigDecimal customPrice1, BigDecimal customPrice2, BigDecimal customPrice3, Integer count, String goodsUnit, String goodsBand, String uniqueCode, String goodsName, Integer goodsEpcid, String goodsCode, String edait, Integer goodsDetailId, Boolean isChecked, Integer buyCount, String mycode) {
        this.id = id;
        this.companyId = companyId;
        this.goodsId = goodsId;
        this.colorId = colorId;
        this.colorValue = colorValue;
        this.sizeId = sizeId;
        this.sizeValue = sizeValue;
        this.barCode = barCode;
        this.retailPrice = retailPrice;
        this.wholesalePrice = wholesalePrice;
        this.purchasingPrice = purchasingPrice;
        this.costPrice = costPrice;
        this.customPrice1 = customPrice1;
        this.customPrice2 = customPrice2;
        this.customPrice3 = customPrice3;
        this.count = count;
        this.goodsUnit = goodsUnit;
        this.goodsBand = goodsBand;
        this.uniqueCode = uniqueCode;
        this.goodsName = goodsName;
        this.goodsEpcid = goodsEpcid;
        this.goodsCode = goodsCode;
        this.edait = edait;
        this.goodsDetailId = goodsDetailId;
        this.isChecked = isChecked;
        this.buyCount = buyCount;
        this.mycode = mycode;
    }

    protected GoodsDetailVO(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readInt();
        }
        if (in.readByte() == 0) {
            companyId = null;
        } else {
            companyId = in.readInt();
        }
        if (in.readByte() == 0) {
            goodsId = null;
        } else {
            goodsId = in.readInt();
        }
        if (in.readByte() == 0) {
            colorId = null;
        } else {
            colorId = in.readInt();
        }
        colorValue = in.readString();
        if (in.readByte() == 0) {
            sizeId = null;
        } else {
            sizeId = in.readInt();
        }
        sizeValue = in.readString();
        barCode = in.readString();
        if (in.readByte() == 0) {
            count = null;
        } else {
            count = in.readInt();
        }
        goodsUnit = in.readString();
        goodsBand = in.readString();
        uniqueCode = in.readString();
        goodsName = in.readString();
        if (in.readByte() == 0) {
            goodsEpcid = null;
        } else {
            goodsEpcid = in.readInt();
        }
        goodsCode = in.readString();
        edait = in.readString();
        if (in.readByte() == 0) {
            goodsDetailId = null;
        } else {
            goodsDetailId = in.readInt();
        }
        byte tmpIsChecked = in.readByte();
        isChecked = tmpIsChecked == 0 ? null : tmpIsChecked == 1;
        if (in.readByte() == 0) {
            buyCount = null;
        } else {
            buyCount = in.readInt();
        }
    }

    public static final Creator<GoodsDetailVO> CREATOR = new Creator<GoodsDetailVO>() {
        @Override
        public GoodsDetailVO createFromParcel(Parcel in) {
            return new GoodsDetailVO(in);
        }

        @Override
        public GoodsDetailVO[] newArray(int size) {
            return new GoodsDetailVO[size];
        }
    };

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getColorId() {
        return colorId;
    }

    public void setColorId(Integer colorId) {
        this.colorId = colorId;
    }

    public String getColorValue() {
        return colorValue;
    }

    public void setColorValue(String colorValue) {
        this.colorValue = colorValue;
    }

    public Integer getSizeId() {
        return sizeId;
    }

    public void setSizeId(Integer sizeId) {
        this.sizeId = sizeId;
    }

    public String getSizeValue() {
        return sizeValue;
    }

    public void setSizeValue(String sizeValue) {
        this.sizeValue = sizeValue;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public BigDecimal getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(BigDecimal retailPrice) {
        this.retailPrice = retailPrice;
    }

    public BigDecimal getWholesalePrice() {
        return wholesalePrice;
    }

    public void setWholesalePrice(BigDecimal wholesalePrice) {
        this.wholesalePrice = wholesalePrice;
    }

    public BigDecimal getPurchasingPrice() {
        return purchasingPrice;
    }

    public void setPurchasingPrice(BigDecimal purchasingPrice) {
        this.purchasingPrice = purchasingPrice;
    }

    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    public BigDecimal getCustomPrice1() {
        return customPrice1;
    }

    public void setCustomPrice1(BigDecimal customPrice1) {
        this.customPrice1 = customPrice1;
    }

    public BigDecimal getCustomPrice2() {
        return customPrice2;
    }

    public void setCustomPrice2(BigDecimal customPrice2) {
        this.customPrice2 = customPrice2;
    }

    public BigDecimal getCustomPrice3() {
        return customPrice3;
    }

    public void setCustomPrice3(BigDecimal customPrice3) {
        this.customPrice3 = customPrice3;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getGoodsUnit() {
        return goodsUnit;
    }

    public void setGoodsUnit(String goodsUnit) {
        this.goodsUnit = goodsUnit;
    }

    public String getGoodsBand() {
        return goodsBand;
    }

    public void setGoodsBand(String goodsBand) {
        this.goodsBand = goodsBand;
    }

    public String getUniqueCode() {
        return uniqueCode;
    }

    public void setUniqueCode(String uniqueCode) {
        this.uniqueCode = uniqueCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Integer getGoodsEpcid() {
        return goodsEpcid;
    }

    public void setGoodsEpcid(Integer goodsEpcid) {
        this.goodsEpcid = goodsEpcid;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getEdait() {
        return edait;
    }

    public void setEdait(String edait) {
        this.edait = edait;
    }

    public Integer getGoodsDetailId() {
        return goodsDetailId;
    }

    public void setGoodsDetailId(Integer goodsDetailId) {
        this.goodsDetailId = goodsDetailId;
    }

    public Boolean getChecked() {
        return isChecked;
    }

    public void setChecked(Boolean checked) {
        isChecked = checked;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(id);
        }
        if (companyId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(companyId);
        }
        if (goodsId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(goodsId);
        }
        if (colorId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(colorId);
        }
        dest.writeString(colorValue);
        if (sizeId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(sizeId);
        }
        dest.writeString(sizeValue);
        dest.writeString(barCode);
        if (count == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(count);
        }
        dest.writeString(goodsUnit);
        dest.writeString(goodsBand);
        dest.writeString(uniqueCode);
        dest.writeString(goodsName);
        if (goodsEpcid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(goodsEpcid);
        }
        dest.writeString(goodsCode);
        dest.writeString(edait);
        if (goodsDetailId == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(goodsDetailId);
        }
        dest.writeByte((byte) (isChecked == null ? 0 : isChecked ? 1 : 2));
        if (buyCount == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(buyCount);
        }
    }

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }
}
